package querymgr

import (
	"context"

	"github.com/stackrox/rox/central/vulnmgmt/vulnerabilityrequest/common"
	v1 "github.com/stackrox/rox/generated/api/v1"
	"github.com/stackrox/rox/generated/storage"
)

// VulnReqQueryManager provides functionality to answer derived field queries related to vulnerability requests.
//
//go:generate mockgen-wrapper
type VulnReqQueryManager interface {
	DeploymentCount(ctx context.Context, requestID string, query *v1.Query) (int, error)
	ImageCount(ctx context.Context, requestID string, query *v1.Query) (int, error)
	Deployments(ctx context.Context, requestID string, query *v1.Query) ([]*storage.Deployment, error)
	Images(ctx context.Context, requestID string, query *v1.Query) ([]*storage.Image, error)
	ImageV2s(ctx context.Context, requestID string, query *v1.Query) ([]*storage.ImageV2, error)
	// VulnsWithState returns a map (key=CVE name, value=vulnerability state) of snoozed/suppressed vulnerabilities for the specified scope.
	VulnsWithState(ctx context.Context, scope common.VulnReqScope) (map[string]storage.VulnerabilityState, error)
	// EffectiveVulnReq returns the vulnerability request that directly impacts the cve (specified by cve name) in the given scope.
	EffectiveVulnReq(ctx context.Context, cve string, scope common.VulnReqScope) (*storage.VulnerabilityRequest, error)
}
